<div class="row" ms-controller="Cars">
    <!--标题-->
    <div class="col-md-12">

        <div class="row">
            <div :if="@Type=='Edit'" class="col-md-8">
                <div class="row">
                    <div class="col-md-4">
                        <input class="form-control" placeholder="名称" type="text" :duplex="@EditData.Title">
                    </div>
                    <div class="col-md-4">
                        <select class="form-control" name="" id="Class" :duplex="@EditData.PClassIDs">
                            <option value="0">无</option>
                            <option :for="v in @Search.L" :attr="{value:v.ClassID}">{{v.Title}}</option>
                        </select>
                    </div>
                    <div class="col-md-2">
                        <button class="btn btn-success" :click="@DoSave()">保存</button>
                    </div>
                </div>

            </div>
            <div class="col-md-8" :if="@Type=='Add'">
                <div class="row"><div class="col-md-4">
                    <input class="form-control" placeholder="名称" type="text" :duplex="@AddData.Title">
                </div>
                    <div class="col-md-4">
                        <select class="form-control" name="" id="AddData" :duplex="@AddData.PClassIDs">
                            <option value="0">无</option>
                            <option :for="v in @Search.L" :attr="{value:v.ClassID}">{{v.Title}}</option>
                        </select>
                    </div>
                    <div class="col-md-2">
                        <button class="btn btn-success" :click="@DoAdd()">添加</button>
                    </div>
                </div>
            </div>
            <button class="pull-right btn btn-info" ms-click="@Type='Add'">添加</button>
        </div>


        <!-- 列表-->
        <br>

        <table class="table table-responsive table-bordered" style="margin-bottom: 50px;">
            <thead style="text-align: center;word-break: keep-all;white-space: nowrap">
            <tr>
                <td>#</td>
                <td>
                    车牌号
                </td>
                <td>
                    司机姓名
                </td>
                <td>
                    二维码
                </td>
                <!--<td>-->
                <!--父级分类-->
                <!--</td>-->
                <td style="min-width: 145px;">操作</td>
            </tr>
            </thead>
            <tbody>
            <tr ms-for="(k,v) in @Search.L" class="ola-pointer">
                <td style="cursor: pointer;text-align: center" class="ola-pointer">
                    {{k+1}}
                </td>
                <td>
                    {{v.CarNumber}}
                </td>
                <td>
                    {{v.Driver}}
                </td>
                <td>
                    <img ms-attr="{src:'http://tool.oschina.net/action/qrcode/generate?data='+@v.QRCode+'&output=image%2Fgif&error=L&type=0&margin=0&size=1&1494907054408'}"  alt="">
                </td>
                <td style="text-align: left;min-width: 133px;">
                    <button class="btn btn-sm btn-link" :click-1="@Type='Edit'" :click-2="@EditData=v">编辑</button>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="80">
                    <div class="row">
                        <div class="col-md-5">
                            <span>第&nbsp;</span><span>{{@Search.P}}</span><span>&nbsp;页</span>&nbsp;&nbsp;
                            <span>共&nbsp;</span><span>{{@Search.TP}}</span><span>&nbsp;页</span>
                        </div>
                        <div class="col-md-5">
                            <ul class="pagination" style="margin: 0 0 0 0;">
                                <li :if="@Search.P>1"><a :click="@Search.P--">&laquo;</a></li>
                                <li :for="v in @Search.Pages" :click="@Search.P=v"><a
                                        :class="[(@Search.P==v?'selected':'')]">{{v}}</a></li>
                                <li :if="@Search.P<@Search.TP"><a :click="@Search.P++">&raquo;</a></li>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            </tfoot>
        </table>


        <!-- 分页-->
        <div style="margin-bottom: 120px;">
        </div>
        <div :if="@html.length>0" class="layui-layer-shade" id="layui-layer-shade" times="1"
             style="z-index:19891014; background-color:#000; opacity:0.3; filter:alpha(opacity=30);"></div>
        <div :if="@html.length>0" class="layui-layer layui-layer-page layui-layer-demo layer-anim-02" id="layui-layer"
             type="page" times="1" showtime="0" contype="string"
             style="z-index: 19891015; width: 80%; height: 80%; top: 87.5px; left: 144px;">
            <div id="" class="layui-layer-content" style="height: 698px;" ms-html="@html">
            </div>
            <span class="layui-layer-setwin"><a class="layui-layer-ico layui-layer-close layui-layer-close2"
                                                href="javascript:;" :click-1="@html=''" :click-2="@Type='List'">

        </a></span><span class="layui-layer-resize"></span>
        </div>
    </div>

</div>
